package com.xauto.pioneer.appuser.view;

import android.app.Dialog;
import android.content.Context;
import android.widget.TextView;

import com.xauto.pioneer.appuser.R;
import com.xauto.pioneer.appuser.util.StringUtils;

/**
 * @author Created by ShangGuan on 15-03-04.
 */
public class LoadingDialog extends Dialog {
    private String message;

    public LoadingDialog(Context context, String message) {
        super(context, R.style.LoadingDialogTheme);
        this.message = message;
        init(context);
    }

    private void init(Context context) {
        setContentView(R.layout.dialog_loading);
        TextView tv = (TextView) findViewById(R.id.tv);
        if (!StringUtils.isBlank(message)) {
            tv.setText("正在加载");
        } else {
            tv.setText(message);
        }
//		requestWindowFeature(Window.FEATURE_NO_TITLE);
        setCanceledOnTouchOutside(false);
        setCancelable(false);
    }
}
